package com.have.blog.admin.controller;


import com.have.blog.admin.annotion.operationLogger.OperationLogger;
import com.have.blog.base.validator.group.Update;
import com.have.blog.xo.service.admin.WebConfigService;
import com.have.blog.xo.vo.WebConfigVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 网站配置管理接口
 *
 */
@Api(value = "网站配置相关接口", tags = {"网站配置相关接口"})
@RestController
@RequestMapping("/webConfig")
@Slf4j
public class WebConfigController {
    @Autowired
    private WebConfigService webConfigService;

    @ApiOperation(value = "获取网站配置", notes = "获取网站配置")
    @GetMapping("/getWebConfig")
    public String getWebConfig() {
        return webConfigService.getWebConfig();
    }

    @OperationLogger(value = "修改网站配置")
    @ApiOperation(value = "修改网站配置", notes = "修改网站配置")
    @PostMapping("/editWebConfig")
    public String editWebConfig(@RequestBody WebConfigVo webConfigVO, BindingResult result) {
        return webConfigService.editWebConfig(webConfigVO);
    }
}
